How can I adjust my SQL query to handle multiple rows in a subquery

welcome to shbcf.ru